package net.mycrub.bitwise.core.util;

import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;

import org.apache.commons.math.random.JDKRandomGenerator;
import org.apache.commons.math.random.RandomAdaptor;

public final class Random {
    private static java.util.Random generator;

    static {
        try {
            generator = SecureRandom.getInstance("SHA1PRNG");
        } catch (NoSuchAlgorithmException nsae) {
            nsae.printStackTrace();
            generator = RandomAdaptor.createAdaptor(new JDKRandomGenerator());
        }
    }

    public static double next() {
        return generator.nextDouble();
    }

}
